package com.flurry.android;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

final class v extends RelativeLayout
{
  private static String p = "FlurryAgent";
  private final Context Q;
  private final FlurryAds ae;
  private final String af;
  private final ViewGroup ag;
  private long ah;
  private final ScheduledExecutorService ai;
  private final Runnable aj = new dh(this);
  private ScheduledFuture<?> ak;

  public v(FlurryAds paramFlurryAds, Context paramContext, String paramString, ViewGroup paramViewGroup, ScheduledExecutorService paramScheduledExecutorService)
  {
    super(paramContext);
    this.ae = paramFlurryAds;
    this.Q = paramContext;
    this.af = paramString;
    this.ag = paramViewGroup;
    this.ai = paramScheduledExecutorService;
  }

  private void j()
  {
    try
    {
      k();
      this.ah = 0L;
      removeCallbacks(this.aj);
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  private void k()
  {
    if (this.ak != null)
    {
      new StringBuilder().append("cancel banner rotation for adSpace = ").append(this.af).append(" with fixed rate in milliseconds = ").append(this.ah).toString();
      this.ak.cancel(true);
      this.ak = null;
    }
  }

  private p l()
  {
    if (getChildCount() < 1)
      return null;
    View localView = getChildAt(0);
    try
    {
      p localp = (p)localView;
      return localp;
    }
    catch (ClassCastException localClassCastException)
    {
    }
    return null;
  }

  public final void a(long paramLong)
  {
    try
    {
      if (this.ah != paramLong)
      {
        k();
        this.ah = paramLong;
        if ((this.ai != null) && (this.ak == null) && (0L != this.ah))
        {
          new StringBuilder().append("schedule banner rotation for adSpace = ").append(this.af).append(" with fixed rate in milliseconds = ").append(this.ah).toString();
          this.ak = this.ai.scheduleAtFixedRate(new ak(this), this.ah, this.ah, TimeUnit.MILLISECONDS);
        }
      }
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final ViewGroup h()
  {
    return this.ag;
  }

  public final String i()
  {
    return this.af;
  }

  public final void stop()
  {
    j();
    p localp = l();
    if (localp != null)
      localp.stop();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.flurry.android.v
 * JD-Core Version:    0.6.2
 */